package cn.xz.zysjz.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import cn.xz.zysjz.R;
import cn.xz.zysjz.bean.ActivityListBean;
import cn.xz.zysjz.bean.HomeListBean;
import cn.xz.zysjz.utils.AppHelper;

/**
 * 大厅列表适配器*/
public class ActivityListAdapter extends BaseQuickAdapter<HomeListBean, BaseViewHolder> {

    public ActivityListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, HomeListBean mListBean) {
        //名称
        TextView tvName = helper.getView(R.id.tv_name);
        //免费图标
        ImageView ivG = helper.getView(R.id.iv_pic);
        //
        TextView tvPing = helper.getView(R.id.tv_ping);
        tvName.setText(mListBean.getMsg());
        tvPing.setText("评分: " + mListBean.getGet());
        AppHelper.setLocalPic(ivG,mListBean.getUrl());

        ImageView ivFree = helper.getView(R.id.iv_free);
        ivFree.setVisibility(View.GONE);
        if (mListBean.getFree()){
            ivFree.setVisibility(View.VISIBLE);
        }

    }
}
